﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using correct = SingleResponsibility.correct;
using incerrect = SingleResponsibility.incorrect;
namespace SingleResponsibility
{
    class Program
    {
        static void Main(string[] args)
        {

            //SingleResponsibility.incorrect.Contact contact = new incorrect.Contact();
            //FileStream file = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\test.xlsx", FileMode.OpenOrCreate, FileAccess.ReadWrite);
            //contact.GetFromExcel(file);
            //contact.Save();

            //correct.ISaver<correct.Contact> contactSaver = new correct.ContactSaver();
            //correct.ISaver<correct.Personel> personelSaver = new correct.PersonelSaver();
            //correct.IExcelReader<correct.Contact> contactReader = new correct.ContactExcelReader();
            //correct.IExcelReader<correct.Personel> personeReader = new correct.PersonelExcelReader();

            //console<correct.Personel>(personeReader);
            //console<correct.Contact>(contactReader);

            //console<correct.Personel>(personelSaver, new correct.Personel());
            //console<correct.Contact>(contactSaver, new correct.Contact());

            correct2.ISaver saver = new correct2.ContactSaver();
            console<correct2.Contact>(saver, new correct2.Contact());
            saver = new correct2.PersonelSaver();
            console<correct2.Personel>(saver, new correct2.Personel());

            correct2.IExcelReader reader = new correct2.ContactExcelReader();
            console<correct2.Personel>(reader);
            reader = new correct2.PersonelExcelReader();
            console<correct2.Personel>(reader);
            




            Console.ReadLine();
        }
        static void console<T>(correct.IExcelReader<T> read)
        {
            read.GetReadList();
        }

        static void console<T>(correct.ISaver<T> save, T t)
        {
            save.Save(t);
        }

        static void console<T>(correct2.IExcelReader read)
        {
            read.GetReadList<T>();
        }

        static void console<T>(correct2.ISaver save, T t)
        {
            save.Save(t);
        }

    }
}
